package com.ruoyi.framework.web.service;

import java.util.List;

import com.graphbuilder.curve.ValueVector;
import com.ruoyi.project.base.postInfo.domain.PostInfo;
import com.ruoyi.project.base.postInfo.service.IPostInfoService;
import com.ruoyi.project.base.unitInfo.domain.UnitInfo;
import com.ruoyi.project.base.unitInfo.service.IUnitInfoService;
import com.ruoyi.project.hidden.hiddenLink.domain.HiddenLink;
import com.ruoyi.project.hidden.hiddenLink.service.IHiddenLinkService;
import com.ruoyi.project.hidden.hiddenSys.domain.HiddenSys;
import com.ruoyi.project.hidden.hiddenSys.service.IHiddenSysService;
import com.ruoyi.project.web.videoClassify.domain.VideoClassify;
import com.ruoyi.project.web.videoClassify.service.IVideoClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.dict.domain.DictData;
import com.ruoyi.project.system.dict.service.IDictDataService;
import com.ruoyi.project.system.dict.service.IDictTypeService;

/**
 * RuoYi首创 html调用 thymeleaf 实现字典读取
 * 
 * @author ruoyi
 */
@Service("dict")
public class DictService
{
    @Autowired
    private IDictTypeService dictTypeService;

    @Autowired
    private IDictDataService dictDataService;
    @Autowired
    private IVideoClassifyService classifyService;
    @Autowired
    private IHiddenSysService hiddenSysService;
    @Autowired
    private IHiddenLinkService hiddenLinkService;
    @Autowired
    private IUnitInfoService unitInfoService;
    @Autowired
    private IPostInfoService postInfoService;

    /**
     * 根据字典类型查询字典数据信息
     * 
     * @param dictType 字典类型
     * @return 参数键值
     */
    public List<DictData> getType(String dictType)
    {
        return dictTypeService.selectDictDataByType(dictType);
    }

    /**
     * 根据字典类型和字典键值查询字典数据信息
     * 
     * @param dictType 字典类型
     * @param dictValue 字典键值
     * @return 字典标签
     */
    public String getLabel(String dictType, String dictValue)
    {
        return dictDataService.selectDictLabel(dictType, dictValue);
    }

    /*视频分类*/
    public List<VideoClassify> selectVideoClassifyList()
    {
        VideoClassify videoClassify = new VideoClassify();
        videoClassify.setStatus("0");
        List<VideoClassify> list = classifyService.selectVideoClassifyList(videoClassify);
        return list;
    }
    /*隐患系统*/
    public List<HiddenSys> selectHiddenSysList()
    {
        HiddenSys sys = new HiddenSys();
        sys.setStatus("0");
        List<HiddenSys> hiddenSys = hiddenSysService.selectHiddenSysList(sys);
        return hiddenSys;
    }
    /*单位*/
    public List<UnitInfo> selectUnitInfoList()
    {
        List<UnitInfo> list = unitInfoService.selectUnitInfoList(null);
        return list;
    }

    /*隐患环节*/
    public List<HiddenLink> selectHiddenLinkList()
    {
        HiddenLink sl= new HiddenLink();
        sl.setStatus("0");
        List<HiddenLink> list = hiddenLinkService.selectHiddenLinkList(sl);
        return list;
    }
}
